Skip to content

docs(skills): a line-add action sets the price; a self-tied create gets a current_user default - #34019

Merged
os-zhuang merged 5 commits into
mainfrom
claude/project-thread-i6qv7j
Nov 16, 2026
Merged

os-zhuang merged 5 commits into
mainfrom
claude/project-thread-i6qv7j

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread
Fixes #33978

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:两条搭建教学。① 界面技能 actions.md:「给父记录加明细行」的动作必须设置单价(从产品读价,或在角色可定价时设为必填参数),附一个可类型检查的示例;② 数据技能 security.md:插入策略的 check 绑定当前用户的字段时,给该字段设 defaultValue: 'current_user',用户只说「加一个任务」也能建成。各配一条评测用例。
  • 为什么改:评测里聊天写数据失败,6 次明细行金额写成空(加行动作没有价格),14 次建任务 403(策略要求用户没说的负责人)。维护者原话「聊天里改数据 出问题的关键还是我们的skills需要优化吧?」。
  • 风险与回滚:仅技能文档、评测与 token 天花板,不改运行时;回滚即 revert。actions.md 天花板 2453→2808、security.md 3959→4041、objectstack-ui SKILL.md 3814→3833(先删重复,余额按实测提高)。
  • 先看:skills/objectstack-ui/rules/actions.md(新段落与示例)→ skills/objectstack-data/rules/security.md(own_tasks 策略与四行说明)→ scripts/check-skills-token-ratchet.mjs(两行天花板与算式)。
  • 两分钟验证:node scripts/check-skills-token-ratchet.mjs,预期 actions.md 显示 2808 / 2808、security.md 4041 / 4041,全部通过。
  • 需要你做的:批准本 PR

What changes

  • skills/objectstack-ui/rules/actions.md § Action Parameter Patterns: An action that adds a child line sets its price. lookupAutofill fills only the form and the grid, and a stored expression reads only its own row, so a body inserting invoice, product and quantity alone stores no amount. Read the price from the source the build declares, or take it as a required param where the persona sets prices. One os:check example (crm_add_invoice_line, type: 'script', params product and quantity borrowed with objectOverride: 'invoice_line', a body with api.read + api.write that reads product.list_price, throws when the product is not found, and inserts the line; refreshAfter: true, since the invoice's roll-up total moves). Lines also written past the action (API, an agent, an import — one with automations off skips hooks) get the price from a beforeInsert hook on the line, runAs: 'system' when the writer cannot read it.
  • skills/objectstack-ui/SKILL.md § line-item grid behaviors: one clause scoping its "never add an 'Add line' button" to the grid, pointing a record-header action that inserts a priced line to rules/actions.md, so the two do not read as contradicting each other.
  • skills/objectstack-data/rules/security.md § Row-Level Security: the example's second policy becomes the insert-only own_tasks (check: 'assignee == current_user.id', field task.assignee: { type: 'user', defaultValue: 'current_user' }), followed by four lines: a check over a field the request never names refuses a plain create; defaultValue: 'current_user' fills an omitted user field before check is judged.
  • Homes, chosen by where a builder reads it: rule 1 where the add-line action and its params are written; rule 2 directly under the policy example, beside check. relationships.md and field-types.md untouched.
  • Paid down first (standing ruling 「A:先削重复,余额按实测提高」, record 6513306068), each cut keeping a home:
    • actions.md, 85 bytes: "locations is an array of surfaces:" (the H2 names locations, the table header says Surface); the opensInNewTab H3 tail "— async / computed redirect" (its paragraph opens "A redirect URL computed after a fetch"); ", holes in either" on the helpText bullet (the bullet above lists description and a param's helpText among the {{ }} copy holes).
    • security.md, 137 bytes: the org_isolation example policy. A select-only using policy is still shown twice in § Membership keys; current_user.organization_id keeps its placeholder-table row; the tenant predicate is the Layer 0 wall in § Platform-global objects.
  • Evals: skills/objectstack-ui/evals/views-apps-actions-pages.json case 18 (the add-line action); skills/objectstack-data/evals/hooks-security-seeds-datasources.json case 21 (the self-tied create; it follows case 20, which docs(skills): roll-up guidance resolves security-rollup-source-unreadable before finishing #33954 landed, byte-identical after the merge of main). Every must_contain appears verbatim in its expected_output; both must_not_contain lists are empty.
  • scripts/check-skills-token-ratchet.mjs: three rows moved to the measurement (actions.md, security.md, objectstack-ui SKILL.md), arithmetic in the row comments. The review-round additions (35 + 24 tokens) had no true duplicate to cut, so they rest on the ruling's second half.
  • .changeset/33978-line-price-and-self-tied-create.md: '@objectstack/skills': patch.
  • No forced test edits.

Tests

Measured on origin/main before writing (b8ac0e2):

  • defaultValue: 'current_user' is a runtime token on a user field (packages/spec/src/data/field.zod.ts, the defaultValue describe), resolved per request in packages/objectql/src/engine-defaults-and-autonumbers.ts.
  • On insert the engine applies field defaults, then beforeInsert hooks, and the RLS check judges that post-hook row (postHookWriteImageCheck; pinned by packages/plugins/plugin-security/src/insert-check-post-image.test.ts).
  • A CEL defaultValue envelope and a stored expression read only the row being written, so neither can read the product's price; lookupAutofill is client-side only.
  • Action bodies run elevated (packages/runtime/src/action-execution.ts, isSystem: true); hooks run as the operator unless runAs: 'system' (packages/objectql/src/hook-run-as.ts).
Scratch proof (uncommitted vitest file on the insert-check-post-image harness, deleted after) — 5/5 passed
assignee: { type: 'user', defaultValue: 'current_user' } + insert check 'assignee == current_user.id'
  create naming no assignee            -> admitted, stored assignee = the caller
  control: same field, no default      -> PERMISSION_DENIED 403 "the insert would violate a row-level CHECK"
  with the default, naming another user -> still 403
  the taught field parses through ObjectSchema.create
invoice_line amount = record.quantity * record.unit_price
  quantity 3, no unit_price            -> amount null (not 0)
  quantity 3, unit_price 20            -> amount 60
Lock VERDICT command-exit 0 · Test Files 1 passed · Tests 5 passed

Acceptance notes

  • Not taught: the card's alternative for rule 2, "say in the field description that an agent sets it". On main the agent's object description (describeServedObject, packages/runtime/src/domains/mcp.ts) serves name, type, label, required, readonly, system, options and defaultValue per field, and no description, so that route has no measured agent consumer. It does serve defaultValue and tells the agent to omit the field to get it, which is the taught path.
  • The rule 1 example computes the price and takes no price param: the body runs elevated, so an optional override param would let a persona write a price their field grant denies. The param route stays prose ("a required param where the persona sets prices").
  • NOT MEASURED: the example action run through the action runtime (it is type-checked; its mechanics follow the file's existing script example); a hook stamping unit_price for a persona whose field grant denies editing it (the text makes no claim about it).
  • field-types.md's lookupAutofill paragraph still ends at "Client-side only" with no pointer to the new rule; left out to keep to two rule files.
  • Review round (seat at-tier review PASS at 31a2d6d, record 6897741755): N2, N3, N4 applied in one commit; N1 and N5 left as they are.
  • Authoring arrangement: this thread is served below the card's mandated tier, so the skills/** text was authored and committed by an at-tier (CONTRACT_REVIEW_TIER) subagent in the same worktree and branch; push, gates, relay writes and the report stay with the thread.

Verification

Token counts, ceil(utf8 bytes / 4):

Scope Before After
rules/actions.md 185 lines · 9807 B · 2452 tok (ceiling 2453) 224 lines · 11231 B · 2808 tok (ceiling 2808, headroom 0)
rules/security.md 329 lines · 15834 B · 3959 tok (ceiling 3959) 334 lines · 16164 B · 4041 tok (ceiling 4041, headroom 0)
objectstack-ui/SKILL.md (priced bytes, stamp line excluded) 15233 B · 3809 tok (ceiling 3814) 15329 B · 3833 tok (ceiling 3833, headroom 0)
all skills/*/SKILL.md (240e9ab vs head) 4596 lines · 237075 B 4597 lines · 237171 B (+1 line, +96 B)
whole shipped skills/ bundle (ratchet, 240e9ab vs head) 246388 tok (authored 187806, eval 46787) 247470 tok (authored 188268, eval 47407): +462 authored, +620 eval fixture

Local gate union at head 0d221b0 (origin/main 240e9ab merged in; node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, every listed command run, exit captured before any pipe):

  • 65 derived · 64 exit 0 · 1 NOT MEASURED: pnpm check:dual-build-cjs-loads exit 3, PREREQUISITE NOT MET (reads every package's dist/; this worktree built only the spec, client, client-react and plugin-security closures). Declared narrowing; CI carries it.
  • --ran reconciliation: "65 derived famil(ies) accounted for — 64 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)". The union at the previous heads read the same (63 derived, 62 run, 1 NOT MEASURED at both 18e323b and 31a2d6d).
  • Acceptance gates at 0d221b0, each exit 0: pnpm --filter @objectstack/spec check:skill-docs ("Skill docs in sync"), check:skill-refs ("9 generated files in sync with packages/spec"), check:skill-examples ("347 prose examples type-check across 3 surface(s)", after a spec rebuild), node scripts/check-skills-token-ratchet.mjs ("57 authored bundle file(s) within their ceilings") and --self-test ("104 cases pass"), pnpm check:nul-bytes, git diff --check.
  • Not run locally: test:repo (CI's Test Core); the diff touches no test.

…ts a current_user default

objectstack-ui rules/actions.md: an action that inserts a child line reads
the price from the source the build declares (or takes it as a required
param); lookupAutofill and a stored expression do not fill it on a
server-side insert. objectstack-data rules/security.md: a check over a
field the request never names refuses a plain create; defaultValue
'current_user' on the tying user field fills it before check is judged.
One eval case per rule; both token ratchet rows paid down by true
restatement first, then pinned at the measurement.

Claude-Session: https://claude.ai/code/session_01ADHkmQ2cXsNaBaNbjBDxsA
Co-authored-by: Claude <noreply@anthropic.com>
Measured on the engine: a stored expression over an unsent unit_price
persists an empty amount, so the rule text, its eval and the ratchet row
say that instead of naming a zero.

Claude-Session: https://claude.ai/code/session_01ADHkmQ2cXsNaBaNbjBDxsA
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 15, 2026
…-i6qv7j

# Conflicts:
#	skills/objectstack-data/evals/hooks-security-seeds-datasources.json
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 31a2d6d462f7d64048e012fd519ff0ab0b20beab
Local-runs: none
Scope: skills/objectstack-ui/rules/actions.md, skills/objectstack-data/rules/security.md, skills/objectstack-ui/evals/views-apps-actions-pages.json, skills/objectstack-data/evals/hooks-security-seeds-datasources.json + scripts/check-skills-token-ratchet.mjs, .changeset/33978-line-price-and-self-tied-create.md

Read, not reviewed (origin/main at 240e9ab; none of these code files changed since the first reading at a3aa1d2): packages/objectql/src/engine-insert.ts, engine-defaults-and-autonumbers.ts, hook-run-as.ts; packages/runtime/src/action-execution.ts, domains/mcp.ts; packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts, insert-check-post-image.test.ts; packages/lint/src/stored-expression-inputs.ts; packages/spec/src/data/field.zod.ts; the sibling skill files named below.

① Derived judgments

Every taught behaviour was tested against main's code.

Rule 1, actions.md

  • The body's read and write shape: holds. skills/objectstack-data/references/data-hooks.md on main documents findOne({ where: { id } }) under api.read and insert({ … }) under api.write, and says "Action bodies additionally receive ctx.recordId and ctx.record … the action params arrive as the first arg". The example matches the file's own script example (input.campaign_id). The body source is a string, so os:check type-checks the defineAction envelope only; the dev says the run through the action runtime is not measured.
  • "The body runs trusted" (eval 18): holds. action-execution.ts, buildActionExecutionContext: "the caller's envelope, elevated with isSystem: true". hook-run-as.ts: "The security middleware short-circuits on that flag before every row-level and field-level gate".
  • "lookupAutofill fills only the form and the grid": holds. It agrees with field-types.md on main: "in the form and the line-item grid … Client-side only".
  • "A stored expression reads only its own row": holds as the taught doctrine, narrower than the code (nit N1). It repeats relationships.md § Computed column ("It reads only that row"). The engine itself does read one hop: stored-expression-inputs.ts says "the record, ONE hop through a reference field … read as the writer", warned as stored-expression-cross-record-input. For the card's persona, who cannot read the price, that hop yields nothing, so the conclusion stands.
  • "Stores no amount": consistent with the dev's scratch run (amount null, not 0). I did not re-run it.
  • The beforeInsert hook route with runAs: 'system': holds.
    • The hook fires per row for every engine insert (engine-insert.ts, triggerHooks('beforeInsert', rowHookContexts[i])), so it covers the API and an agent.
    • runAs scopes exactly the hook's ctx.api reads, which is what "when the writer cannot read it" needs (hook-run-as.ts: "ctx.api data operations ONLY").
    • Field-level write refusal judges the caller's payload in the middleware, before the hooks, so a hook-stamped unit_price is not refused for a persona without the edit grant. That is my reading of the code; the dev marks it not measured and the text makes no claim on it.
    • One edge is not said here (nit N4): data-hooks.md on main says "an import with automations off skips hooks".

Rule 2, security.md

  • defaultValue: 'current_user' on a user field: holds. field.zod.ts on defaultValue: "current_user on user or lookup with reference: 'sys_user' only". applyFieldDefaults: "current_user token → the acting user's id at insert time"; an omitted or null field gets it, a supplied value is "left untouched".
  • Order, default before check: holds. In engine-insert.ts the defaults run at line 528, the beforeInsert dispatch at line 650 and postHookWriteImageCheck.evaluate(live) at line 1033. insert-check-post-image.test.ts pins "The write check judges THE ROW THAT WILL BE STORED".
  • The insert-only own_tasks policy: holds.
    • Without the default, an omitted assignee fails assignee == current_user.id and the create is refused (403 in the dev's control run).
    • With the default, a create naming another user is still refused, because a supplied value is kept and then judged.
    • operation: 'insert' with check alone agrees with the paragraph above the example.

Card asks not taught

  • The description route of rule 2 ("or document it in the field's description so an agent sets it"). Declared, and right: see ③.
  • Rule 1's parameter route has prose only ("or take it as a required param where the persona sets prices"), no example. The card asks for one short example per rule, and each rule has one.
  • A line asked for at a stated amount still cannot carry that amount through the taught example, which takes no price param. The line gets the list price, not 0, so the card's acceptance (no amount-0 writes) is met.

② Semver level

  • Changeset: '@objectstack/skills': patch. The package name exists on main (packages/skills/package.json).
  • Clause-②: no and Metadata-protocol: none are on both the PR body and the changeset body, line-initial.
  • Both are right: the diff changes no schema, no accepted value and no runtime, so the kind is none and the level is patch under AGENTS.md step 3.
  • The Check Changeset check-run is still running on this head (it concluded success on the earlier head 18e323b, whose changeset is identical).

③ Boundary flags

  • Authoring tier. The claim, the report and the PR body all declare that the skills text was authored by a subagent pinned to this tier inside a thread served below it. It is declared, not verifiable from the tree; Implemented-by carries the branch.
  • One gh api GET read. Declared in the report as a deviation, read-only, no write. Noted.
  • Main merged in. The head is a merge of main 240e9ab, which is also the merge base, so the branch is current. The net diff is the same six files, +110 −12, and its changed lines are identical to those of the earlier head 18e323b.
  • docs(skills): roll-up guidance resolves security-rollup-source-unreadable before finishing #33954 has landed and the conflict is resolved. The data eval file's tail now runs 17, 20, 21. Case 20 is main's, byte for byte (the file differs from main only by the ten added lines of case 21). The ratchet script differs from main only in this PR's two rows.
  • The PR body is stale on two points. It still names head 18e323b for its local gate run and calls case 20 "reserved for docs(skills): roll-up guidance resolves security-rollup-source-unreadable before finishing #33954". The tree is what was judged.
  • Ratchet arithmetic: verified. actions.md is 9807 bytes on main and 11106 at the head, and ceil(11106 / 4) is 2777. security.md is 15834 and 16164, and ceil(16164 / 4) is 4041. Both rows are pinned at the measurement.
  • Paid-down text keeps a home in each case.
    • "locations is an array of surfaces:": the H2 names locations, the table header says Surface, and every example writes the array.
    • The H3 tail "— async / computed redirect": the paragraph under it opens "A redirect URL computed after a fetch". No link in skills/ targets the old anchor.
    • ", holes in either": the bullet above lists description and helpText among the {{ }} holes, and the locale-map example still shows a hole inside the map.
    • org_isolation: a select-only using policy is still shown twice under Membership keys, current_user.organization_id keeps its placeholder row, and the tenant predicate is the Layer 0 wall under Platform-global objects. No other skill file references org_isolation.
  • The dev's open questions: A is right on all three.
    • Description route not taught: describeServedObject (packages/runtime/src/domains/mcp.ts) serves name, type, label, required, readonly, system, options and defaultValue per field, and no description. The route has no agent consumer on main.
    • org_isolation cut: a hand-written tenant policy restates the Layer 0 wall, so the example loses nothing.
    • No pointer in field-types.md: its "Client-side only" already agrees with the new rule. A pointer is a later nicety.
  • The one NOT MEASURED gate. check:dual-build-cjs-loads exited 3 on a missing prerequisite (every package's dist/). The diff changes no package source. The gate is CI's to carry and has no conclusion yet; Build Core is not yet listed on this head.
  • Check-runs on this head: 20 listed so far, none failed.
    • Success (3): Governed Surface Queue Guard, PR-body guards, Check PR Size.
    • Skipped (3): Schedule gate, Packed-tarball smoke, 18.x upgrade harness.
    • Still running (14): Check Changeset, Auto Label, five Lint · jobs (docs and code guards, repo and tooling gates, PM dispatch-gates, ESLint, CI release and engine gates), three Lint · scoped · jobs (slot lookup and corpus, query-options erasure, tooling self-tests), and four Type Check · jobs (debt ledger, source gates, workspace, consumer gates).
    • Not yet listed on this head: Build Core, Test Core, Test UI, Live E2E UI and the queue verdicts.
    • The skills gates (examples, links, ratchet) sit in the running Lint jobs, so their CI verdict is not in. This PASS is the contract verdict, not the gate verdict.
  • The PR is a draft and mergeable_state is blocked.
  • No security item found.

④ Design judgment

No must-fix, no should-fix.

skills/objectstack-ui/rules/actions.md: true against main, clear, and placed where the add-line action and its params are written. The example mirrors the file's existing script action. Computing the price, with no optional price param, is the right call: the body runs elevated, so an optional override would let a persona write a price their field grant denies.

skills/objectstack-data/rules/security.md: true, four lines, directly under the policy they explain. It agrees with field-types.md (the user row lists defaultValue: 'current_user') and with the check paragraph above it.

Eval case 18 (ui): self-consistent. All four must_contain strings are in expected_output, and must_not_contain is empty, so a correct restatement cannot trip it.

Eval case 21 (data): self-consistent. All three must_contain strings are in expected_output, and must_not_contain is empty. Case 20 is main's, untouched; this file's ids are unique.

Ratchet and changeset: the two rows and their comments agree with the measured bytes; the changeset body describes the tree.

Contradiction grep over skills/** (action-side computed fields, hooks, RLS insert checks): none left that changes the rule. relationships.md § Computed column, field-types.md on lookupAutofill, data-hooks.md and the automation skill's runAs note all agree with the new text.

Nits (no effect on the contract):

  • N1. "A stored expression reads only its own row" is the doctrine relationships.md teaches. The engine reads one hop as the writer and warns. The sentence could say "is kept to its own row".
  • N2. objectstack-ui/SKILL.md says of the form's line grid "never add an "Add line" button", and the new example is a header action labelled Add Line. The scopes differ (form grid against record header), but the same words meet. One clause saying when an add-line action is warranted would settle it.
  • N3. The example has no refreshAfter: true, and the next line of the file advises it when the action mutates the current record. Adding a line moves the invoice's roll-up total. The body also dereferences product without a null guard.
  • N4. The hook sentence lists "import" without the exception data-hooks.md states (an import with automations off skips hooks).
  • N5. Eval literals are tight. Case 18 requires unit_price: product.list_price, so a correct body using another variable name fails. Case 21 requires type: 'user', so a correct Field.user({ defaultValue: 'current_user' }) fails. Both empty must_not_contain lists mean a wrong answer is caught only by a missing literal.

Implemented-by: claude/project-thread-i6qv7j
Reviewed-by: session_01ADHkmRxXmVQ41fqnaTPGAv

VERDICT: PASS

…the grid rule names its scope

The Add Line action sets refreshAfter and refuses a product it cannot
find; the hook sentence says an import with automations off skips hooks;
SKILL.md's line-item grid paragraph says its no-button rule is about the
grid and points a record-header insert at rules/actions.md. Both ratchet
rows re-pinned at the measurement.

Claude-Session: https://claude.ai/code/session_01ADHkmQ2cXsNaBaNbjBDxsA
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 0d221b0ccdcb97e6e9e4ef46bc904978978ad189
Local-runs: none
Scope: skills/objectstack-ui/rules/actions.md, skills/objectstack-ui/SKILL.md, skills/objectstack-data/rules/security.md, skills/objectstack-ui/evals/views-apps-actions-pages.json, skills/objectstack-data/evals/hooks-security-seeds-datasources.json + scripts/check-skills-token-ratchet.mjs, .changeset/33978-line-price-and-self-tied-create.md

Delta record. Record 6897741755 (head 31a2d6d) stands as written except where this one reopens it. Judged here: the single commit 0d221b0 on parent 31a2d6d, and the net diff against main (seven files, +132 −16).

Read, not reviewed (origin/main at e71ecc1): packages/spec/src/ui/action.zod.ts, skills/objectstack-data/references/data-hooks.md.

① Derived judgments

The commit touches three files: actions.md, objectstack-ui/SKILL.md and the ratchet script. The other four files of the net diff are byte-identical to 31a2d6d.

  • N3: closed.
    • refreshAfter: true is a real key (action.zod.ts: "Refresh view after execution") and is used as the file's two other examples use it. The file's own closing advice now agrees with its example.
    • if (!product) throw new Error('Product not found.'); sits before the insert, so no line is written without a price. data-hooks.md documents findOne as answering "record | null", which is the case guarded.
    • The message reaches the user as written: action.zod.ts describes errorMessage as "Error message to show when the action fails (overrides the raw error)", and the example sets none. No skill text teaches a throw convention for action bodies, so there is nothing for the line to disagree with. I did not trace the action door's catch path, and the dev still marks the example as not run through the action runtime.
  • N2: closed. The grid paragraph now reads "never add an "Add line" button to the grid" and adds "a record-header action that inserts a priced line is Actions". The link path resolves and matches the file's other rule links. The two texts no longer meet on the same words.
  • N4: closed. The sentence now reads "(API, an agent, an import — one with automations off skips hooks)", which is what data-hooks.md says ("an import with automations off skips hooks").
  • N1: open, unchanged. Still a nit.
  • N5: open, unchanged. Still a nit. Case 18's expected_output and literals still hold against the amended example; it does not mention the guard or refreshAfter, and does not need to.

Nothing the commit adds contradicts main's code or a sibling skill.

② Semver level

Unchanged: '@objectstack/skills': patch, Clause-②: no, Metadata-protocol: none, on the PR body and the changeset. The commit adds prose and one example key, no schema or runtime change, so patch and none still hold.

③ Boundary flags

  • File surface against the claim. The claim allows "the chosen skills/** rule files (at most three …)" and names four candidates. The diff now holds three skills prose files, so the count holds. skills/objectstack-ui/SKILL.md is not one of the named candidates and is not a rules file. The PR body explains the addition (it closes N2); the claim comment on the card is not amended and the card carries no report for this round. That is the owner seat's call, not a defect of the tree.
  • Ratchet rows: arithmetic verified.
    • actions.md is 11231 bytes at the head; ceil(11231 / 4) is 2808.
    • objectstack-ui SKILL.md is 15349 bytes, 15329 priced; ceil(15329 / 4) is 3833. On main it is 15253 bytes (3809 tokens, headroom 5 under 3814).
    • Both rows are pinned at the measurement. security.md is unchanged at 4041.
  • No duplicate cut first. Both row comments say no passage was found restating another and rest the raise on the second half of ruling A. The raises are small (+31 and +19 tokens) and declared. I cannot prove the absence of duplication; the first round's 85-byte cut in actions.md is consistent with it.
  • Main has moved. Main is e71ecc1; the head's merge base is 240e9ab. Since then main changed the ratchet script (another row) and the query skill, none of this PR's skill files. git merge-tree of main and the head is clean.
  • The one NOT MEASURED gate. check:dual-build-cjs-loads, exit 3, prerequisite, in a union of 65 derived and 64 exit 0. Build Core and every Lint and Type Check job concluded success on this head, so CI carries it.
  • Check-runs on this head: 49, none failed, 48 final.
    • Success (30): Build Core, Plan Test Core shards, Test Core, Test Core 1/8, 2/8 and 3/8, Test UI, Live E2E UI, Dogfood Regression Gate, Lint & Repo Gates, TypeScript Type Check, the five Lint · jobs, the three Lint · scoped · jobs, the four Type Check · jobs, Governed Surface Queue Guard, PR-body guards (twice), Check Changeset (first run), Check PR Size, Auto Label, filter.
    • Skipped (18), including Queue verdict, Borrowed queue verdict, and the re-run's Auto Label and Check PR Size.
    • Still running (1): the second Check Changeset, started at 17:31 by the PR-body edit. Its first run on this same head concluded success.
  • The PR is a draft and mergeable_state is unstable.
  • No security item found.

④ Design judgment

No must-fix, no should-fix.

skills/objectstack-ui/rules/actions.md: the example is now complete on its own terms: it refuses a missing product before writing, and it refreshes the invoice whose roll-up it moved. The hook sentence is accurate with its exception.

skills/objectstack-ui/SKILL.md: one clause, true, in the paragraph where the apparent conflict sat. It scopes the existing rule without weakening it.

scripts/check-skills-token-ratchet.mjs: the two re-pinned rows and their comments agree with the measured bytes.

Nits (no effect on the contract):

  • N1 and N5: carried from record 6897741755, unchanged.
  • N6 (new). The changeset body names actions.md and security.md but not the objectstack-ui SKILL.md clause, which also ships.

Implemented-by: claude/project-thread-i6qv7j
Reviewed-by: session_01ADHkmRxXmVQ41fqnaTPGAv

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

维护者速读

  • 改了什么:两条建应用规则补进技能。① objectstack-ui rules/actions.md:加明细行的动作要在动作体里读产品价(os:check 脚本动作读 product.list_price,找不到产品就报错,不写 0),绕过动作直接写入的行(API、agent、导入)用 beforeInsert 钩子加 runAs: 'system' 补价;SKILL.md 补一句区分「行网格不加 Add line 按钮」和「记录头部的加行动作」。② objectstack-data rules/security.md:只许插入自己任务的 RLS(check: assignee == current_user.id)要在 user 字段上配 defaultValue: 'current_user',不然不填负责人的新建会被拒。各加一个评测用例(ui 第 18 例、data 第 21 例)。+132/−16,changeset @objectstack/skills: patch。
  • 为什么改:Authoring skill: line-item add paths must set or compute the amount, and a persona's create policy must not need values the user never says #33978 的评测里,agent 照现有技能写出金额为 0 的明细行,也写出建不了任务的自有任务策略。
  • 风险与回滚:只改技能文字、两个评测用例和三行 token 棘轮上限(actions.md 2808、security.md 4041、ui SKILL.md 3833,都按实测钉住),不动运行时。回滚 = revert。
  • 先看:actions.md 的 Add Line 示例,再看 security.md RLS 示例下面那四行。
  • 两分钟验证:对照 packages/objectql/src/engine-insert.ts,确认字段默认值(约 528 行)先于写入 check(约 1033 行)执行,这正是第二条规则成立的原因。
  • 需要你做的:受管面 Tier H(diff 含 scripts/check-skills-token-ratchet.mjs,低风险技能臂不适用)。达档(CONTRACT_REVIEW_TIER)复审:首轮 6897741755 PASS,delta 6898487855 在本 head PASS,N2–N4 已关。请批准并合并,或批准后由席位落地。
  • 席位意见:可以合。

席位核对

Verdict: ACCEPT, held for the maintainer · head 0d221b0ccdcb97e6e9e4ef46bc904978978ad189 · card #33978 · report 6897643339 · at-tier contract review 6897741755 (PASS on 31a2d6d4, nits only) + delta 6898487855 (PASS on this head, N2: closed, N3: closed, N4: closed) · read 2026-11-15T17:34Z.

  • Shape: draft → main, Fixes #33978. skills/objectstack-ui/rules/actions.md, skills/objectstack-ui/SKILL.md, skills/objectstack-data/rules/security.md, one case in each of objectstack-ui/evals/views-apps-actions-pages.json (18) and objectstack-data/evals/hooks-security-seeds-datasources.json (21), three ratchet rows, changeset '@objectstack/skills': patch. GOVERNED, Tier H. Clause-②: no; Metadata-protocol: none.
  • Premise measured: the review checked each taught behaviour against main's code (action elevation, beforeInsert with runAs, current_user default before the insert check), and the dev's scratch test proved both rules (5/5).
  • Gates: 49 check-runs on this head, none failed; every Lint, Type Check, Build, Test Core, Test UI and Live E2E UI job is green. A second Check Changeset from the body edit is the only one still finishing; its first run on this head is green. Dev: 65 derived, 64 exit 0, 1 NOT MEASURED (check:dual-build-cjs-loads exit 3, prerequisite dist/; CI's Build Core carries it), and --ran reconciles.
  • Accepted deviations: authoring by a subagent pinned to CONTRACT_REVIEW_TIER inside a lower-tier thread (declared in the claim and body). One read-only gh api GET. Main merged in to take docs(skills): roll-up guidance resolves security-rollup-source-unreadable before finishing #33954's case 20. objectstack-ui/SKILL.md entered the diff at the seat's request, to close N2. The ratchet raises rest on the second half of ruling A, with no duplicate found to cut. The open questions are answered A: the description route is not taught, org_isolation is cut, and the field-types pointer is left out. Nits N1, N5 and N6 are left as they are.
  • Out of scope: none filed.
  • Landing: Tier H. The seat does not flip this PR ready or enqueue it. It needs the maintainer's merge, or an authorised APPROVED review after which the seat lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

Serial note for the maintainer: this PR and PR #34105 (card #33566) both edit skills/objectstack-data/rules/security.md and the same row of scripts/check-skills-token-ratchet.mjs (#34105: 3959 → 3986; this PR: 3959 → 4041), each measured against main alone. Whichever merges second will conflict on that row, and its ceiling must be re-measured on the combined file. Merge either one; the seat then merges main into the other, re-pins the row to the measured size (paying in place first), and runs a delta review before it asks again. Neither PR needs anything from you beyond the merge.

@os-zhuang
os-zhuang marked this pull request as ready for review November 16, 2026 01:51
@os-zhuang
os-zhuang enabled auto-merge November 16, 2026 01:51
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

Landing at 2026-11-16T01:51Z: GOVERNED_APPROVERS approval 5914178398 (os-zhuang) is on the current head 0d221b0c. The seat's ACCEPT 6898497314 stands. Base check: main moved the published-skills token ratchet since this PR's base 240e9ab5. The seat merged origin/main into this head locally: the merge is clean and check-skills-token-ratchet stays green (57 authored files within their ceilings). So no refresh push is owed, and the approval stays on the head. The merge queue builds against current main.

Serial note (6900101001): PR #34105 also adds eval id 21 to hooks-security-seeds-datasources.json and moves the same security.md ratchet row. It lands second, after a main merge, id 21 → 22, the row re-pinned to the merged measurement, and a delta review.

@os-zhuang
os-zhuang added this pull request to the merge queue Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 43788769507 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (1/8) — 失败步骤: Run this shard's tests

    @objectstack/spec:test:      ✓ inverts the card's measured control: the three bogus keys now FAIL parse instead of adding zero warnings  390ms
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    @objectstack/spec:test:repo:  FAIL   repo  scripts/root-index.test.ts > content/docs/references/index.mdx (the committed page) > states no count that its own rows contradict
      ↳ 失败原因: @objectstack/spec:test:repo: AssertionError: expected [ 218, 1663 ] to deeply equal [ 218, 1664 ]
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 18 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Authoring skill: line-item add paths must set or compute the amount, and a persona's create policy must not need values the user never says

3 participants